package com.yhn.smartalbum.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yhn.smartalbum.model.dto.common.DeleteRequest;
import com.yhn.smartalbum.model.dto.req.*;
import com.yhn.smartalbum.model.dto.resp.UserLoginRespDTO;
import com.yhn.smartalbum.model.dto.resp.UserRespDTO;
import com.yhn.smartalbum.model.entity.User;
import jakarta.servlet.http.HttpServletRequest;

/**
 * @author 86177
 * @description 针对表【user(用户)】的数据库操作Service
 * @createDate 2024-12-27 16:17:55
 */
public interface UserService extends IService<User> {

    /**
     * 用户注册
     *
     * @param requestParam 用户注册请求
     * @return 新用户id
     */
    long userRegister(UserRegisterRequestDTO requestParam);


    /**
     * 用户登录
     *
     * @param requestParam 登录请求
     * @param request      http请求
     * @return 脱敏数据
     */
    UserLoginRespDTO userLogin(UserLoginRequestDTO requestParam, HttpServletRequest request);

    /**
     * 获取当前登录用户
     *
     * @param request http请求
     * @return 当前登录用户
     */
    UserLoginRespDTO getLoginUser(HttpServletRequest request);

    /**
     * 用户注销
     *
     * @param request http请求
     * @return 是否注销成功
     */
    boolean userLogout(HttpServletRequest request);

    Long addUser(UserAddRequestDTO requestParam);

    UserRespDTO getUserById(Long id);

    Boolean deleteUser(DeleteRequest requestParam);

    boolean updateUser(UserUpdateRequestDTO requestParam);

    Page<UserRespDTO> listUserByPage(UserQueryRequestDTO requestParam);
}
